# 会议纪要
from django.db import models
from conference.models import Conference
from danwei.models import Danwei


# Create your models here.
class Summary(models.Model):  # 会议纪要
    id = models.AutoField(primary_key=True)
    title = models.CharField(max_length=255, blank=True, null=True)
    paper_copy = models.IntegerField(blank=True, null=True)  # 纸质份数,
    digital_copy = models.IntegerField(blank=True, null=True)  # 电子份数
    content = models.FileField(upload_to="download/Summary", blank=True, null=True)
    conference_id = models.ForeignKey(  # 关联会议
        Conference,
        on_delete=models.CASCADE,
        related_name="summary",
        blank=True,
        null=True,
    )
    publish_danwei = models.ForeignKey(  # 发布单位
        Danwei,
        on_delete=models.CASCADE,
        related_name="send_summary",
        blank=True,
        null=True,
    )
    print_danwei = models.ForeignKey(  # 印发单位
        Danwei,
        on_delete=models.CASCADE,
        related_name="publish_summary",
        blank=True,
        null=True,
    )
    publish_time = models.DateTimeField(blank=True, null=True)  # 发布日期
    print_time = models.DateTimeField(blank=True, null=True)  # 印发日期
